﻿namespace Sidvall.Data
{
    public class FieldItem
    {
        #region Public Members

        public string FieldName { get; set; }
        public DataType ValueDataType { get; set; }
        public bool IsPrimaryKey { get; set; }
        public bool IsGenerated { get; set; }
        public ConcurrencyMode ConcurrencyMode { get; set; }

        #region InUpdateFilter

        public bool InUpdateFilter
        {
            get
            {
                if (this.IsPrimaryKey)
                    return true;
                if (this.ConcurrencyMode == Data.ConcurrencyMode.Fixed)
                    return true;
                return false;
            }
        }

        #endregion

        #region ToString

        public override string ToString()
        {
            return this.FieldName;
        }

        #endregion

        #endregion
        #region Constructors

        public FieldItem()
        {
        }

        #endregion
    }
}
